package com.dc.project.entity.dto;

import com.dc.project.entity.bo.TaskResultGenerateBo;
import com.own.component.common.base.entity.BaseDto;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * TaskResultGenerateDto
 *
 * @author chenxueli
 * @date 2025-03-10 16:37:53
 */
@Schema(title = "任务最终材料生成记录" + ConstantBeanSuffix.DTO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class TaskResultGenerateDto extends BaseDto<TaskResultGenerateBo> implements Serializable {

    @Schema(title = "任务id")
    private Long taskId;

    @Schema(title = "详细信息id")
    private Long detailId;

    @Schema(title = "对应的材料项目id")
    private Long itemId;

    @Schema(title = "生成的文件名称")
    private String fileName;

    @Schema(title = "描述")
    private String description;

    @Schema(title = "材料id")
    private Long fileId;

    @Schema(title = "材料路径")
    private String filePath;

    @Schema(title = "解析状态 1=未开始 2=文件解析文本成功 3=文件解析文本失败")
    private Integer parseStatus;

    @Schema(title = "解析消息")
    private String parseMessage;

    /**
     * 转业务层对象
     *
     * @param entity 原业务层对象
     * @return 业务层对象
     */
    @Override
    public TaskResultGenerateBo toBo(TaskResultGenerateBo entity) {
        if (entity == null) {
            entity = new TaskResultGenerateBo();
        }
        entity.setTaskId(this.taskId);
        entity.setDetailId(this.detailId);
        entity.setItemId(this.itemId);
        entity.setFileName(this.fileName);
        entity.setDescription(this.description);
        entity.setFileId(this.fileId);
        entity.setFilePath(this.filePath);
        entity.setParseStatus(this.parseStatus);
        entity.setParseMessage(this.parseMessage);
        return super.toBo(entity);
    }

}

